package com.sky.controller.user;

import com.sky.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController("userShopController")
@RequestMapping("/user/shop")
@Slf4j
public class UserShopController {

    @Autowired
    private RedisTemplate redisTemplate;

    private static final String SHOP_STATUS = "shop_status";

    /*
    * 获取店铺营业状态
    * */
    @GetMapping("/status")
    public Result setShopStatus() {
        Integer status = (Integer)redisTemplate.opsForValue().get(SHOP_STATUS);
        log.info("getShopStatus status:{}", status);
        return Result.success(status);
    }
}
